package cn.ml.lambda;

import java.util.Arrays;
import java.util.List;

public class s {
    public static void main(String[] args) {

        String[] array = {"aaaa", "bbbb", "cccc"};
        List<String> list = Arrays.asList(array);
        System.out.println(list);

        //Java 7
        System.out.println("-------增强for----------");
        for(String s:list){
            System.out.println(s);
        }

        //Java 8
        System.out.println("-------双冒号(::)----------");
        list.forEach(System.out::println);
        //或者
        System.out.println("-------lambda----------");
        list.forEach(s->System.out.println(s));

    }
}
